package com.kehongborui.fliggy.controller;

import com.kehongborui.fliggy.annotation.LogAction;
import com.kehongborui.fliggy.entity.User;
import com.kehongborui.fliggy.mapper.UserMapper;
import com.kehongborui.fliggy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhang peng yang ming
 * @CopyRight (C) http://www.csdn.com
 * @brief
 * @email 122162005@qq.com
 * @date 2018-08-27
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @LogAction(action = "查找所有用户信息")
    @GetMapping
    public List<User> findAll() {
        return null;
    }

    @LogAction(action = "查找用户信息")
    @GetMapping("/{id}")
    public User findById(@PathVariable("id") String uid) {
        return userService.findById(uid);
    }

    @PostMapping
    public User create(@RequestBody User user) {
        return user;
    }
}
